class YXLocalizations {
  bool isEnglish = false;
  String localStringOne;
  String token;

  // 创建一个单例
  YXLocalizations._();
  static YXLocalizations _instance;
  static YXLocalizations share() {
    if (_instance == null) {
      _instance = YXLocalizations._();
    }
    return _instance;
  }

  Map localMap = {
    '更新密码': 'Change Password',
    '输入老密码': 'Enter old password',
    '输入新密码': 'Enter new password',
    '确认新密码': 'Confirm new password',
    '确定': 'Confirm',
    '忘记密码? >': 'Forgot Password? >',
  };

  // 如果是英文，则从字典中取值，如果中文，则直接返回原值
  localString(String context) {
    return isEnglish ? localMap[context] : context;
  }
}
